package cn.donting.jme.expansion.attribute.lmpl;

import cn.donting.jme.expansion.attribute.Attribute;
import cn.donting.jme.swing.layout.HorizontalAutoLayout;
import com.formdev.flatlaf.extras.components.FlatTextField;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;

public class LabelAttribute extends Attribute<String> {

    private JPanel jPanel;
    private JLabel titleLabel;


    public LabelAttribute(String title) {
        jPanel = new JPanel(new HorizontalAutoLayout());
        this.titleLabel = new JLabel(title);
        jPanel.add(titleLabel);
        setTitle(title);
    }

    @Override
    public void setValue(String value) {
    }

    @Override
    public String getValue() {
        return "";
    }

    @Override
    public void setTitle(String title) {
        titleLabel.setText(title);
    }

    @Override
    public String getTitle() {
        return titleLabel.getText();
    }

    @Override
    public Container getUIContainer() {
        return jPanel;
    }

    @Override
    public void setTip(String tip) {
        titleLabel.setToolTipText(tip);
    }


    @Override
    public void setEnable(boolean enable) {
        jPanel.setEnabled(enable);
    }

    @Override
    public void showEnableCheckBox(boolean enable) {

    }


}
